CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

include_directories(${PROJECT_ROOT})
include_directories(${PROJECT_ROOT}/comn/include)
include_directories(.)
include_directories(include)
include_directories(util)
include_directories(src)


include_directories(${FFMPEG_DIR}/include)
include_directories(${THIRD_PARTY}/jsoncpp-0.10.6/include)


if (MSVC)
	include_directories(${THIRD_PARTY}/stdint)
    include_directories(win)
endif()

link_directories(${PROJECT_ROOT}/comn/lib)
link_directories(${PROJECT_ROOT}/lib)
link_directories(${FFMPEG_LIBRARY_DIR})

include_directories(rtp)
include_directories(${JRTP_INCLUDE})
link_directories(${JRTP_LIBRARY_DIR})

aux_source_directory(. SOURCE)
aux_source_directory(src SOURCE)
aux_source_directory(util SOURCE)
aux_source_directory(rtp SOURCE)


FILE(GLOB HEADER "*.h")
	aux_source_directory(win SOURCE)
	
if (MSVC)
    
else()
    list(REMOVE_ITEM SOURCE ./dllmain.cpp)
endif()

#aux_source_directory(jni UI_SOURCE)
#include_directories("E:/Android/sdk/ndk-bundle/platforms/android-16/arch-arm/usr/include")

add_library(MediaReader SHARED ${SOURCE} ${HEADER} ${UI_SOURCE} MediaReader.rc)

target_link_libraries(MediaReader
    debug comnd optimized comn
    ${FFMPEG_LIBRARIES}
	debug jsoncppd optimized jsoncpp
	${JRTP_LIBRARIES}
	${LIB_PLATFORM}
	)

set_target_properties(MediaReader PROPERTIES LINK_INTERFACE_LIBRARIES "")
set_target_properties(MediaReader PROPERTIES INTERFACE_LINK_LIBRARIES "")
set_target_properties(MediaReader PROPERTIES LINK_FLAGS_RELEASE "/OPT:NOREF")
set_property(TARGET MediaReader PROPERTY POSITION_INDEPENDENT_CODE TRUE)
